<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        s = "hello"
        var reverseString = function(s) {
            s = s.split('')
            var string = ''
            for (let i=s.length-1;i>=0;i--){
                string += s[i]
            }
            return string
        };

        var reverseString2 = function(s) {
            return s.split('').reverse().join('')
        };

        console.log(reverseString2(s));
    </script>
</body>
</html>